function myajax(url, data = {}, type = "get") {
    return new Promise((resolve, reject) => {
        $.ajax({
            type,
            data,
            url,
            dataType: "json",
            success: function (res) {
                resolve(res)
            },
            error: function (e) {
                reject(e)
            }

        })
    })
}




